/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entitybean;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author Admin
 */
@Entity
@Table(name = "media_comment", catalog = "OnlineShopFourDVD", schema = "dbo")
@NamedQueries({
    @NamedQuery(name = "MediaComment.findAll", query = "SELECT m FROM MediaComment m"),
    @NamedQuery(name = "MediaComment.findByCommentId", query = "SELECT m FROM MediaComment m WHERE m.commentId = :commentId"),
    @NamedQuery(name = "MediaComment.findByCommentDate", query = "SELECT m FROM MediaComment m WHERE m.commentDate = :commentDate"),
    @NamedQuery(name = "MediaComment.findByVisible", query = "SELECT m FROM MediaComment m WHERE m.visible = :visible"),
    @NamedQuery(name = "MediaComment.findByStatus", query = "SELECT m FROM MediaComment m WHERE m.status = :status")})
public class MediaComment implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "comment_id", nullable = false)
    private Integer commentId;
    @Column(name = "comment_date")
    @Temporal(TemporalType.TIMESTAMP)
    private Date commentDate;
    @Column(name = "visible")
    private Character visible;
    @Column(name = "status")
    private Character status;
    @JoinColumn(name = "user_id", referencedColumnName = "user_id", nullable = false)
    @ManyToOne(optional = false)
    private Users users;
    @JoinColumn(name = "media_id", referencedColumnName = "media_id", nullable = false)
    @ManyToOne(optional = false)
    private Media media;

    public MediaComment() {
    }

    public MediaComment(Integer commentId) {
        this.commentId = commentId;
    }

    public Integer getCommentId() {
        return commentId;
    }

    public void setCommentId(Integer commentId) {
        this.commentId = commentId;
    }

    public Date getCommentDate() {
        return commentDate;
    }

    public void setCommentDate(Date commentDate) {
        this.commentDate = commentDate;
    }

    public Character getVisible() {
        return visible;
    }

    public void setVisible(Character visible) {
        this.visible = visible;
    }

    public Character getStatus() {
        return status;
    }

    public void setStatus(Character status) {
        this.status = status;
    }

    public Users getUsers() {
        return users;
    }

    public void setUsers(Users users) {
        this.users = users;
    }

    public Media getMedia() {
        return media;
    }

    public void setMedia(Media media) {
        this.media = media;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (commentId != null ? commentId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof MediaComment)) {
            return false;
        }
        MediaComment other = (MediaComment) object;
        if ((this.commentId == null && other.commentId != null) || (this.commentId != null && !this.commentId.equals(other.commentId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entitybean.MediaComment[commentId=" + commentId + "]";
    }

}
